package practise_6.dao;

import practise_6.domain.User;
import practise_6.exception.PasswordException;
import practise_6.exception.UserNameException;

public class UserDao {
    public static boolean login(User loginUser) throws PasswordException, UserNameException {
        User user = new User("w", "123456");//外部传入的内容
        if(!user.getUserName().equals(loginUser.getUserName())) {
            throw new UserNameException();
        } else if(!user.getPassword().equals(loginUser.getPassword())) {
            throw new PasswordException();
        }
        return true;
    }
}
